import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 机器人APP版本信息 */
export interface RobotAppVersion {
          id: number; // ID
          versionCode?: number; // 版本号
          versionName?: string; // 版本名称
          downloadUrl?: string; // 下载地址
          releaseNotes: string; // 更新说明
          forceUpdate?: boolean; // 是否跟新说明
  }

// 机器人APP版本 API
export const RobotAppVersionApi = {
  // 查询机器人APP版本分页
  getRobotAppVersionPage: async (params: any) => {
    return await request.get({ url: `/rbt/robot-app-version/page`, params })
  },

  // 查询机器人APP版本详情
  getRobotAppVersion: async (id: number) => {
    return await request.get({ url: `/rbt/robot-app-version/get?id=` + id })
  },

  // 新增机器人APP版本
  createRobotAppVersion: async (data: RobotAppVersion) => {
    return await request.post({ url: `/rbt/robot-app-version/create`, data })
  },

  // 修改机器人APP版本
  updateRobotAppVersion: async (data: RobotAppVersion) => {
    return await request.put({ url: `/rbt/robot-app-version/update`, data })
  },

  // 删除机器人APP版本
  deleteRobotAppVersion: async (id: number) => {
    return await request.delete({ url: `/rbt/robot-app-version/delete?id=` + id })
  },

  /** 批量删除机器人APP版本 */
  deleteRobotAppVersionList: async (ids: number[]) => {
    return await request.delete({ url: `/rbt/robot-app-version/delete-list?ids=${ids.join(',')}` })
  },

  // 导出机器人APP版本 Excel
  exportRobotAppVersion: async (params) => {
    return await request.download({ url: `/rbt/robot-app-version/export-excel`, params })
  }
}